package com.example.springdemo7.Controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/get")
public class PropertiesController {
    @Value("${byte.key1}")
    private String key1;
    @Value("${byte.key2}")
    private String key2;
    @Value("${spring.datasource.url}")
    private String URL;
    @RequestMapping("/getKey")
    public String getKey1() {
        return "获取到配置文件中的key：" + key1 + "," + key2;
    }
    @RequestMapping("/getUrl")
    public String getURL() {
        return "获取到的URL：" + URL;
    }
}
